package teacher.action;

import com.opensymphony.xwork2.ActionSupport;

import teacher.bean.Paper;
import teacher.bean.Teacher;
import teacher.service.flow;
import teacher.service.paper;

public class deletePap extends ActionSupport {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int paperid;
	String suc;

	public String getSuc() {
		return suc;
	}

	public void setSuc(String suc) {
		this.suc = suc;
	}

	public int getPaperid() {
		return paperid;
	}

	public void setPaperid(int paperid) {
		this.paperid = paperid;
	}

	public String execute() throws Exception {
		
		Paper p=new Paper();
		p.setPapId(paperid);
		if(new flow().DeleteFlow(paperid, 1))//删除流程
		{System.out.println("删除流程成功！！！");}
		if(new paper().DeletePaper(p))
		{
			this.setSuc("success");
		return SUCCESS;}
		else{
			return ERROR;
		}
	}


	
}
